package com.l.web.master.webcontent;

import com.l.web.master.system.webnode.WebNode;
import com.l.web.master.system.webnode.WebNodeDAO;
import com.l.web.master.system.webnode.WebNodeType;
import org.apache.log4j.Logger;
import org.l.qiao.Cluster;
import org.l.qiao.Validate;
import com.l.web.util.ServiceSupport;

/**
 * Created by 严秋旺 on 2015/4/28.
 */
public class WebContentServiceX extends ServiceSupport {

    private static final Logger LOGGER = Logger.getLogger(WebContentServiceX.class);

    private WebNodeDAO webNodeDAO;
    private WebContentDAO webContentDAO;

    public void setWebNodeDAO(WebNodeDAO webNodeDAO) {
        this.webNodeDAO = webNodeDAO;
    }

    public void setWebContentDAO(WebContentDAO webContentDAO) {
        this.webContentDAO = webContentDAO;
    }

    public String execute() {
        String id = "";//form.getString("id");
        if (Validate.check(Validate.OBJECTID, id)) {
            Cluster webNode = webNodeDAO.findById(id);
            String type = webNode.getString(WebNode.TYPE, "");
            switch (type) {
                case WebNodeType.SINGLETON_ARTICLE:
                    break;
                case WebNodeType.ARTICLE_LIST:
                    break;
                case WebNodeType.URL:
                    break;
            }

        } else {
//            LOGGER.error("无效参数值：id=" + id);
//            error(404);
//            return NONE;
        }
        return null;
    }

}
